package com.auto.learning.fragment;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.text.Html;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.auto.learning.R;

public class ReadChapterFrgment extends Fragment {

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
		View view = inflater.inflate(R.layout.read_chapter_fragment, null);
		TextView textView = (TextView) view.findViewById(R.id.tv_charpter);
		TextView tv_title = (TextView) view.findViewById(R.id.tv_title);
		textView.setText(Html.fromHtml(getArguments().getString("data")));
		tv_title.setText(getArguments().getString("title"));
		tv_title.setTextIsSelectable(true);
		textView.setTextIsSelectable(true);
		return view;
	}
	
	public static Fragment newInstance(String type,String title){
        Fragment fragment = new ReadChapterFrgment();
        Bundle bundle = new Bundle();
        bundle.putString("title", title);
        bundle.putString("data", type);
        fragment.setArguments(bundle);
        return fragment;
    }
	
	
}
